
<!--------------------------------------------刘猛------------------------------------------------------------------>
<template>
    <el-container style="height: 600px; border: 1px solid #eee">
        <el-header style="text-align:right; font-size: 20px;height: 200px; padding-top:40px">
            <el-form inline="ture" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
                <el-form-item label="订单号" prop="orderid">
                    <el-col :span="20">
                        <el-input v-model="ruleForm.orderid" size="small" ></el-input>
                    </el-col>

                </el-form-item>
                <el-form-item label="配送中心" prop="dispatchcenter">
                    <el-select v-model="ruleForm.dispatchcenter" placeholder="请选择配送中心" size="small">
                        <el-option label="上海" value="shanghai"></el-option>
                        <el-option label="北京" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="库房" prop="store">
                    <el-select v-model="ruleForm.store" placeholder="请选择库房" size="small">
                        <el-option label="C1区A2座" value="shanghai"></el-option>
                        <el-option label="C1区A3座" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <br/>
                <el-form-item  >
                    <el-button type="primary" @click="submitForm('ruleForm')"  style="text-align:left" >领取订单</el-button>
                    <el-button @click="resetForm('ruleForm')">重置</el-button>
                </el-form-item>
            </el-form>
        </el-header>

        <el-main>
            <el-table
                    :data="tableData"
                    border
                    style="width: 100%">
                <el-table-column
                        fixed
                        prop="orderid"
                        label="订单号"
                        width="150">
                </el-table-column>
                <el-table-column
                        prop="dispatchcenter"
                        label="配送中心"
                        width="150">
                </el-table-column>
                <el-table-column
                        prop="store"
                        label="库房"
                        width="150">
                </el-table-column>
                <el-table-column
                        prop="fina_time"
                        label="截单时间"
                        width="150">
                </el-table-column>
                <el-table-column
                        prop="timestyle"
                        label="时效类型"
                        width="150">
                </el-table-column>
                <el-table-column
                        prop="ordertime"
                        label="下单时间"
                        width="150">
                </el-table-column>
                <el-table-column
                        fixed="right"
                        label="操作"
                        width="100">
                    <template slot-scope="scope">
                        <el-button @click="handleClick(scope.row)" type="text" >调度</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="block" style="text-align: right">
                <P></P>
                <el-pagination
                        @current-change="handleCurrentChange"
                        :page-size="5"
                        layout="total, prev, pager, next, jumper"
                        :total="20">
                </el-pagination>
            </div>
        </el-main>

    </el-container>
</template>

<script>
    export default {
        data() {
            return {
                ruleForm: {
                    orderid: '',
                    dispatchcenter: '',
                    store: ''
                },
                rules: {
                    dispatchcenter: [
                        {  message: '请选择配送中心', trigger: 'change' }
                    ],
                    store: [
                        {  message: '请选择日期', trigger: 'change' }
                    ]
                }
            };
        },
        methods: {
            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        alert('submit!');
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            resetForm(formName) {
                this.$refs[formName].resetFields();
            }
        }
    }
</script>
